<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
	</head>
	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" style="width: 100%;" class="table_style">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
	</body>
	<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
	<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../../JS/common.js"></script>
	<script type="text/javascript" src='../../../JS/SHA-1.js'></script>
	<script type="text/javascript">
		var currid = getID(); 
		var content = ""; 
		content = AddToolBar(3 + TOOLBAR_REDO);
		$("#toolbar").append(content); 

		function newdata() {  //新增
			AddTabIn("订单管理", parent.parent.$('#tabs'), "UI/LOGISTICS/StockTransferOrder/StockTransferOrderAdd.html?id=-1");
		}

		function editdata() {  //编辑
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('Info', "请选择你需要修改数据"); 
				return;
			}
			AddTabIn("移库单据修改", parent.parent.$('#tabs'), "UI/LOGISTICS/StockTransferOrder/StockTransferOrderAdd.html?id=" + row.ID);
		}
		
		function redodata(){
			checkAllData("/logistics/stocktransferorder/list.do");
		}

		$('#dg').datagrid({
			url: RemoteLinkAddress + '/logistics/stocktransferorder/list.do',
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			autoRowHeight: 'true',
			fitColumns: 'false',
			height: 350,
			columns: [
				[{
					field: 'cb',
					checkbox: 'true',
				}, {
					field: 'ID',
					title: 'ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'ORDER_NO',
					title: '单据编号',
					width: '16%',
					align: 'center'
				}, {
					field: 'FROMSTOREHOUSE_NAME',
					title: '源库房',
					width: '16%',
					align: 'center'
				}, {
					field: 'FROMSTOREHOUSE_ID',
					title: '源库房ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'TOSTOREHOUSE_NAME',
					title: '目标库房',
					width: '16%',
					align: 'center'
				}, {
					field: 'TOSTOREHOUSE_ID',
					title: '目标库房ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'CREATE_MAN',
					title: '建单人',
					width: '15%',
					align: 'center'
				}, {
					field: 'CREATE_TIME',
					title: '建单时间',
					width: '15%',
					align: 'center'
				}, {
					field: 'ISVERIFY',
					title: '审核状态',
					width: '15%',
					align: 'center',
					formatter: function(value, row, index) {
							return verifyStatus(value,false);
						}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "";
				pLocation = "UI/LOGISTICS/StockTransferOrder/StockTransferOrderAdd.html?id=" + row.ID;
				AddTabIn("移库单详情", parent.parent.$("#tabs"), pLocation);
			}
		});
		$('#dg').datagrid('hideColumn', 'ID');
		$('#dg').datagrid('hideColumn', 'FROMSTOREHOUSE_ID');
		$('#dg').datagrid('hideColumn', 'TOSTOREHOUSE_ID');
	</script>
</html>
